Electronic compasses are used for showing direction, for example, in cars and in wristop computers. In such compasses, there are typically two or three magnetic-field sensors perpendicular to each other, detecting the components of the magnetic field. Such arrangements are disclosed in, for example, U.S. Pat. No. 6,817,106 and US application publication 2010/0312509.
Naturally, the sensors are sensitive to not only the magnetic field of the Earth, but also to other external magnetic fields and to magnetic fields originating from the device itself. Magnetizing substances in the vicinity of the device will also deform external magnetic fields, which can also cause distortion in the compass reading. Due to such interference, an accurate reading requires the compass to be calibrated before the actual determining of direction. Correction usually takes place by calibration made by the user. Some wristop computers are also known, in which calibration is performed by the user first who sets the device in a calibration state, and then turns around 360 degrees holding the device in the hand. The centre point of a magnetic circle is defined from the data collected during this rotation and is used to calculate the compass direction based on new measurements when the device is in a compass state. Problems with this method are that calibration is slow and difficult and that if the calibration is not done often enough, the device's direction reading may not necessarily be reliable.
Calibration is thus mainly intended to eliminate the effect of static interference factors arising from the operating environment from direction determination. However, in actual direction determination, the measurement noise causes a problem which is mainly due to the tilting of the magnetic sensors away from the horizontal plane. The signal they transmit will then not correspond to the real compass direction, but methods to take this noise into account are required. US publications U.S. Pat. Nos. 6,356,851, 8,239,153, and 2002/0035791 describe the problem field relating to the calibration of electronic compasses and disclose some methods for performing the actual calibration in compasses.
The method disclosed in U.S. Pat. No. 6,356,851 is based on seeking minimum and maximum sensor readings. The device is moved in such a way that measurement data is obtained from all the quarters of a circle corresponding to different bearings. This kind of calibration is poorly suited for example for trekking use and in wristop devices, and also requires a very pure signal if it is to operate reliably.
The method disclosed in US publication 2002/0035791 is based on measuring three x,y point pairs corresponding to different positions of the device and solving a circle equation on the basis of the measurements. One drawback of the method is that the device requires a considerable amount of rotation in order to make a successful calibration. In addition, the method is relatively demanding mathematically, i.e. it consumes much power. Because of the aforementioned reasons, the response times also become unnecessarily long.
U.S. Pat. No. 8,239,153 discloses an auto-calibration method, which continuously monitors changes taking place in the magnetic field of the environment, and calculates when re-calibration is needed. The actual calibration event is not an issue here. This approach too has the downside of high power consumption.
FI patent 120276 discloses a compass device, in which, when the compass is used, it is calibrated continuously when the measured data is of a sufficiently high quality for performing the calibration. In this device, there is no need for a separate calibration state; instead calibration takes place in the direction-display state when the compass is used, if the predefined quality criteria for the compass signal are met.
Most of the known devices are however restricted to measuring magnetic fields in a plane, i.e. in a 2D state. The quality of 2D-calibration is highly dependent on local conditions, because the farther from the equator that one is, the greater is the vertical component of the magnetic field and the detrimental noise produced by it, and the more easily tilting of the compass will produce an error requiring compensation. The accuracy of the sensors, the user's movements, and the calculation methods used also affect the need for and the result of calibration. Calibration typically requires intensive calculation and/or the user to repeat the calibration several times, before achieving acceptable accuracy.
One way of calculating the offset vector of a magnetic field is disclosed in U.S. Pat. No. 7,177,779, in which calculation is performed in three dimensions (3D). In this case, both the offset vector and the radius of the magnetic circle are determined, thus using methods requiring intensive calculation, such as matrix calculation and statistical algorithms, and a large number of checks must be made of the correctness of the estimates of the compass direction.